<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title></title>
<#include "/jeecms_sys/head.html"/>
<script type="text/javascript">
function getTableForm() {
	return document.getElementById('tableForm');
}
function optDelete() {
	if(Pn.checkedCount('ids')<=0) {
		alert("<@s.m 'error.checkRecord'/>");
		return;
	}
	if(!confirm("<@s.m 'global.confirm.delete'/>")) {
		return;
	}
	var f = getTableForm();
	f.action="o_delete.do";
	f.submit();
}
function optPriority() {
	var f = getTableForm();
	f.action="o_priority.do";
	f.submit();
}
</script>
</head>
<body>
<div class="body-box">
<div class="rhead">
	<div class="rpos"><@s.m "global.position"/>: <@s.m "channel.function"/> - <@s.m "global.list"/></div>
	<form class="ropt">
		<input type="hidden" name="root" value="${root!}"/>
		<@cms_perm url="/channel/v_add.do">
		<select name="modelId" onchange="if(this.options[this.selectedIndex].value!=''){this.form.action='v_add.do';this.form.submit();}">
			<option>--<@s.m "channel.addChild"/>--</option>
			<#list modelList as model>
			<option value="${model.id}">${model.name}</option>
			</#list>
		</select>
		</@cms_perm>
	</form>
	<div class="clear"></div>
</div>
<form id="tableForm" method="post">
<input type="hidden" name="root" value="${root!}"/>
<input type="hidden" name="pageNo" value="${pageNo!}"/>
<@p.table value=list;channel,i,has_next><#rt/>
	<@p.column title="<input type='checkbox' onclick='Pn.checkbox(\"ids\",this.checked)'/>" width="20">
		<input type='checkbox' name='ids' value='${channel.id}'/><#t/>
	</@p.column><#t/>
	<@p.column title="ID">${channel.id}<input type="hidden" name="wids" value="${channel.id}"/></@p.column><#t/>
	<@p.column code="channel.name">${channel.name} [<span style="color:red">${channel.model.name}</span>]</@p.column><#t/>
	<@p.column code="channel.path">${channel.path}</@p.column><#t/>
	<@p.column code="channel.priority" align="center"><input type="text" name="priority" value="${channel.priority}" style="width:40px"/></@p.column><#t/>
	<@p.column code="channel.display" align="center"><#if channel.display><@s.m "global.true"/><#else><@s.m "global.false"/></#if></@p.column><#t/>
	<@p.column code="global.operate" align="center">
		<@cms_perm url="/channel/v_edit.do">
		<a href="v_edit.do?id=${channel.id}" class="pn-opt"><@s.m "global.edit"/></a> | <#rt/>
		</@cms_perm>
		<@cms_perm url="/channel/o_delete.do">
		<a href="o_delete.do?ids=${channel.id}&root=${root!}" class="pn-opt" onclick="if(!confirm('<@s.m "global.confirm.delete"/>')) {return false;}"><@s.m "global.delete"/></a><#t/>
		</@cms_perm>
	</@p.column><#t/>
</@p.table>
<div>
	<@cms_perm url="/channel/o_delete.do">
	<input type="button" value="<@s.m "global.delete"/>" onclick="optDelete();"/>
	</@cms_perm>
	<@cms_perm url="/channel/o_priority.do">
&nbsp; <input type="button" value="<@s.m "global.saveOrder"/>" onclick="optPriority();"/>
	</@cms_perm>
</div>
</form>
</div>
<#include "/common/alert_message.html"/>
</body>
</html>